#ifndef SELECTDATA_H
#define SELECTDATA_H

#include <QMainWindow>
#include <QObject>
#include <QWidget>

class SelectData {
public:
    SelectData();

    const QString getDirPath() const {
        QStringList list;
        list.append(rootPath);
        list.append(dirText);
        QString value = list.join("/");
        return value;
    }

    const QString getRootPath() const {
        return rootPath;
    }

    void setRootPath(const QString rootPath) {
        this->rootPath = rootPath;
    }

    const QString getDirText() const {
        return dirText;
    }

    void setDirText(const QString dirText) {
        this->dirText = dirText;
    }

    const QString getFileText() const {
        return fileText;
    }

    void setFileText(const QString fileText) {
        this->fileText = fileText;
    }

    int getRowDir() const {
        return rowDir;
    }

    void setRowDir(int rowDir) {
        selectDir = this->rowDir == rowDir;
        if (selectDir) {
            return;
        }
        rowFile = -1;
        this->rowDir = rowDir;
    }

    int getRowFile() const {
        return rowFile;
    }

    void setRowFile(int rowFile) {
        selectFile = this->rowFile == rowFile;
        this->rowFile = rowFile;
    }

    bool isSelectDir() const {
        return selectDir;
    }

    bool isSelectFile() const {
        return selectFile;
    }

    const QString getCurFile() const {
        QStringList list;
        list.append(getDirPath());
        list.append(fileText);
        QString vv = list.join("/");
        return vv;
    }

private:
    int rowFile = -1;
    int rowDir = -1;
    bool selectFile;
    bool selectDir;
    QString rootPath;
    QString dirText;
    QString fileText;
    QString dirPath;
    //	QString absolutePath;
    QString curFile;

};

#endif // SELECTDATA_H
